package com.xwj.entity;

import org.apache.commons.lang3.StringUtils;

import java.beans.Transient;
import java.io.Serializable;

/**
 * Created by xuweijie on 2018/1/26.
 * 请求响应实体
 */
public class ResponseInfoEntity implements Serializable {

    private static final long serialVersionUID = -2783207139369406325L;
    private String info;
    private int status;
    private int success;
    private int fail;
    private int id;

    public ResponseInfoEntity() {
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getSuccess() {
        return success;
    }

    public void setSuccess(int success) {
        this.success = success;
    }

    public int getFail() {
        return fail;
    }

    public void setFail(int fail) {
        this.fail = fail;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Transient
    public void set_id(String _id) {
        if (StringUtils.isBlank(_id))
            return;
        this.id = Integer.parseInt(_id);
    }

    @Override
    public String toString() {
        return "ResponseInfoEntity{" +
                "info='" + info + '\'' +
                ", status=" + status +
                ", success=" + success +
                ", fail=" + fail +
                ", id=" + id +
                '}';
    }
}
